package net.csdn.business.discuss.feign.api;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.csdn.business.discuss.common.constant.ServiceNameConstants;
import net.csdn.business.discuss.common.model.dto.OrgMemberIdDTO;
import net.csdn.business.discuss.common.model.dto.UserRoleDto;
import net.csdn.business.discuss.common.model.vo.OrgInfoVo;
import net.csdn.business.discuss.common.model.vo.UserInfoVO;
import net.csdn.business.discuss.feign.decoder.SystemFeignErrorDecoder;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Auther: zhangyalei
 * @Date: 2022/12/21 16:59
 * @Description:
 */
@FeignClient(value = ServiceNameConstants.ATOMGIT_SYSTEM_SERVICE,contextId = ServiceNameConstants.ATOMGIT_SYSTEM_ORG_CONTEXT_ID, configuration = SystemFeignErrorDecoder.class)
public interface OrgFeignClient {

    /**
     * @Desc: 批量查询组织成员信息,最多100个
     * @Author: zhangyalei
     * @Date: 2023/1/11 15:18
     */
    @GetMapping("/api/v1/org/memberAll/{orgId}")
    public List<UserInfoVO> getOrgMemberAll(@PathVariable("orgId") String orgId);

    /**
     * @Desc: 查询组织的成员角色
     * @Author: zhangyalei
     * @Date: 2023/1/11 15:18
     */
    @PostMapping("/api/v1/org/getAccessLevel")
    public Integer getOrgAccessLevel(@RequestBody UserRoleDto params);


    /**
     * @Desc: 根据组织id获取组织基本信息
     * @Author: zhangyalei
     * @Date: 2023/1/11 15:18
     */
    @PostMapping("/api/v1/org/getById")
    public OrgInfoVo getById(@RequestParam("id")String id);


    /**
     * @Desc: 分页查询组织成员id,最多50个
     * @Author: zhangyalei
     * @Date: 2023/1/11 15:18
     */
    @PostMapping("/api/v1/org/member/idList")
    public Page<String> getOrgMemberId(@RequestBody OrgMemberIdDTO query)throws Exception;

}